Learn about how Algolia ranks, using its tie-breaking algorithm, and how you can control that ranking with Custom Ranking.
popularity
attribute (descending):
rating
and views
(in that order) as custom ranking attributes. If the rating across records is unnecessarily precise—say “4.321321”—the views may never be used to break the tie. However, the search results may not be more relevant. A movie with a slightly lower rating but many more views would rank lower, while you would expect it to rank higher.
To fix the situation, create another attribute (say truncated_rating
) with values rounded to one decimal place. In this example, “4.321321” becomes “4.3”. By reducing the precision of the rating
attribute, it makes it more likely to have several records with the same truncated_rating
, allowing them to tie-break on the count
attribute.